/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package phys;

import vec.Vector3f;

/**
 *
 * @author Vic
 */
public class State {

    protected Vector3f position;
    protected Vector3f impulse;
   protected  Vector3f momentum;
    
//    Quat4f spin;
//    Quat4f orientation;
    protected Vector3f angularMomentum;
    
    protected Vector3f velocity;
    protected Vector3f angularVelocity;
    
    protected float mass;
    protected float inverseMass;
    protected float initertia;
    protected float inverseInertia;

    public State() {
        position=new Vector3f();
        momentum=new Vector3f();
        impulse= new Vector3f();
//        spin= new Quat4f();
//        orientation= new Quat4f();
        angularMomentum=new Vector3f();
        velocity=new Vector3f();
        angularVelocity= new Vector3f();
    }
    

    public void recalculate() {
//        momentum.scale(inverseMass, velocity);
//        
//        angularMomentum.scale(inverseInertia, angularVelocity);
//        orientation.normalize();
//        
//        new Quat4f(0,angularVelocity.x,angularVelocity.y,angularVelocity.z).mul(orientation, spin);
//        spin.scale(.5f);
    }
    public void setMass(float mass)
    {
        this.mass=mass;
        this.inverseMass=1f/mass;
    }

    @Override
    public String toString() {
        return "State{" + "position=" + position + ", impulse=" + impulse + ", velocity=" + velocity + ", mass=" + mass + '}';
    }

    public Vector3f getPosition() {
        return position;
    }

    public Vector3f getImpulse() {
        return impulse;
    }

    public Vector3f getMomentum() {
        return momentum;
    }

    public Vector3f getAngularMomentum() {
        return angularMomentum;
    }

    public Vector3f getVelocity() {
        return velocity;
    }

    public Vector3f getAngularVelocity() {
        return angularVelocity;
    }

    public float getMass() {
        return mass;
    }

    public float getInverseMass() {
        return inverseMass;
    }

    public float getInitertia() {
        return initertia;
    }

    public float getInverseInertia() {
        return inverseInertia;
    }

    public void setPosition(Vector3f position) {
        this.position = position;
    }

    public void setImpulse(Vector3f impulse) {
        this.impulse = impulse;
    }

    public void setAngularMomentum(Vector3f angularMomentum) {
        this.angularMomentum = angularMomentum;
    }

    public void setVelocity(Vector3f velocity) {
        this.velocity = velocity;
    }

    public void setInverseMass(float inverseMass) {
        this.inverseMass = inverseMass;
    }

    public void setInitertia(float initertia) {
        this.initertia = initertia;
    }
    
}
